package com.thx.log.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thx.common.service.BaseManager;
import com.thx.log.dao.LogDao;
import com.thx.log.model.Log;

@Service
@Transactional(readOnly = true)
public class LogManager extends BaseManager<Log> {
	
	@Autowired
	private LogDao logdao;

	public List<Log> searchLogs(String username,String startTime,String endTime) {
		return logdao.searchLogs(username,startTime,endTime);
	}

	public Log findLastLoginLogByUserId(String module,
			String action, String userId) {
		return logdao.findLastLoginLogByUserId(module,action,userId);
	}

	public Long getAppAccessNum(String appName,String startTime,String endTime) {
		return logdao.getAppAccessNum(appName,startTime,endTime);
	}

	public List<String> getAppModule(String appName) {
		return logdao.getAppModule(appName);
	}

	public Long getModuleAccessNum(String appName, String module, String startTime, String endTime) {
		return logdao.getModuleAccessNum(appName, module, startTime, endTime);
	}

}
